package com.example.sendmessage.client;

import java.io.IOException;

/**
 * 实现连接工厂的逻辑
 */
public class ConnectionFactory {
    // 服务器的ip地址
    private String host;
    // 服务器的端口号
    private int port;
    // todo:具体访问哪个虚拟主机，待扩展
//    private String virtualHostName;
//    private String username;
//    private String password;
    public Connection newConnection() throws IOException {
        Connection connection = new Connection(host, port);
        return connection;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }
}
